# syntax=docker/dockerfile:1
FROM maven:3.9.6-eclipse-temurin-17 AS build
WORKDIR /app
COPY ../../pom.xml ./
COPY ../../common ./common
COPY . ./code-generation-service
RUN mvn -q -DskipTests -f code-generation-service/pom.xml package

FROM eclipse-temurin:17-jre
WORKDIR /app
COPY --from=build /app/code-generation-service/target/*.jar app.jar
ENV SPRING_PROFILES_ACTIVE=docker
EXPOSE 8082
ENTRYPOINT ["java","-jar","/app/app.jar"]
